<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<div class="jumbotron">
	<h2>Elenco File inseriti e Inserimento CSS e Immagini</h2>
	<form:form method="post"
		action="${pageContext.request.contextPath}/epub/conferma.do"
		commandName="myfileform" enctype="multipart/form-data">
		<div>
			<table class="table table-hover">
				<thead>
					<h3>Scegli i nomi dei capitoli</h3>
					<tr>
						<td><b>Vecchio Nome File</b></td>
						<td><b>Nuovo Nome File</b></td>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${files}" var="files" varStatus="status">
						<tr>

							<td>${files.originalFileName}</td>
							<input type="hidden" id="nomeFile[${status.index}]"
								name="nomeFile[${status.index}]"
								path="nomeFile[${status.index}]"
								value="${files.originalFileName}" />
							<td><input class="form-control" type="text"
								id="nomeChapter[${status.index}]"
								name="nomeChapter[${status.index}]"
								path="nomeChapter[${status.index}]"
								value="${files.indentazione}" /></td>

						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
</div>
<div class="jumbotron">
	<h2>Inserisci i File Restanti</h2>
	<div class="col-md-6">
		<div class="form-group">
			<p style="font-size: 0.6em;">Qui inserisci i file .css</p>
			<form:input path="commonsMultipartFilesCSS" type="file"
				class="btn btn-default" multiple="multiple" />
			<form:errors path="commonsMultipartFilesCSS" />
		</div>
	</div>
	<div class="col-md-6">
		<div class="form-group">
			<p style="font-size: 0.6em;">Qui inserisci i file .jpg</p>
			<form:input path="commonsMultipartFilesIMG" type="file"
				class="btn btn-default" multiple="multiple" />
			<form:errors path="commonsMultipartFilesIMG" />
		</div>
	</div>


<div style="text-align: center; padding-right: 16%;">
	<input type="submit" value="Upload" class="btn btn-primary" /> <input
		type="button" value="Back" class="btn btn-default"
		onclick="javascript:history.back()" />
</div>
</div>
</form:form>